package org.littlesun.management.ui.test;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Device;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import swing2swt.layout.BorderLayout;
import org.eclipse.wb.swt.SWTResourceManager;

public class BorderLayoutWindowTest2 {

	protected Shell shell;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		BorderLayoutWindowTest2 window = new BorderLayoutWindowTest2();
		window.open();
	}

	/**
	 * Open the window.
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		
		shell = new Shell();
		shell.setSize(450, 300);
		shell.setText("SWT Application");
		shell.setLayout(new BorderLayout(0, 0));

	    Composite toolbarArea = new Composite(shell, SWT.NO_FOCUS);
	    toolbarArea.setLayoutData(BorderLayout.NORTH);
	    toolbarArea.setLayout(new RowLayout(SWT.HORIZONTAL));
	    
	    Button button1 = new Button(toolbarArea, SWT.PUSH);
	    button1.setText("Add...");
//	    button1.setLayoutData(layoutData);
//	    buttonSouth.setLayoutData(BorderLayout.SOUTH);  
//	    buttonNorth.setText("North");
//	    buttonNorth.setLayoutData(BorderLayout.NORTH);
	    
	    Button buttonSouth = new Button(shell, SWT.PUSH);
	    buttonSouth.setText("South");
	    buttonSouth.setLayoutData(BorderLayout.SOUTH);  

	    Composite centerArea = new Composite(shell, SWT.NO_FOCUS);
	    centerArea.setLayoutData(BorderLayout.CENTER);
	    centerArea.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
	    
	}

}
